<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>商品分类列表</title>
    <link href="__ADMIN__/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="__ADMIN__/css/style.css" />
    <link href="__ADMIN__/assets/css/codemirror.css" rel="stylesheet">
    <link rel="stylesheet" href="__ADMIN__/assets/css/ace.min.css" />
    <link rel="stylesheet" href="__ADMIN__/font/css/font-awesome.min.css" />
    <script src="__ADMIN__/js/jquery-1.9.1.min.js"></script>
    <script src="__ADMIN__/assets/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/Widget/Validform/5.3.2/Validform.min.js"></script>
    <script src="__ADMIN__/assets/js/typeahead-bs2.min.js"></script>
    <script src="__ADMIN__/assets/js/jquery.dataTables.min.js"></script>
    <script src="__ADMIN__/assets/js/jquery.dataTables.bootstrap.js"></script>
    <script src="__ADMIN__/js/lrtk.js" type="text/javascript"></script>
    <script src="__ADMIN__/assets/layer/layer.js" type="text/javascript"></script>
    <script src="__ADMIN__/assets/laydate/laydate.js" type="text/javascript"></script>
    <script type="text/javascript">var ajax_url = "{:url(MODULE_NAME.'/GoodsClass/ajaxRecommand')}";</script>
    <script src="__ADMIN__/js/goods_class.js" type="text/javascript"></script>
    <style>
        .ajax_get {
            cursor: pointer;
        }
        .class_name {
            text-align: left !important;
        }
    </style>

</head>

<body>
    <div class="crumbs">
        <ul>
            <li>
                <a class="active" href="javascript:;">商品分类列表</a>
            </li>
        </ul>
    </div>
    <div class="administrator">
        <div class="d_Confirm_Order_style">
            <form action="{:url('GoodsClass/index')}" method="post">
                <div class="search_style">
                    <ul class="search_content clearfix">
                        <li>
                            <label class="l_f">商品分类中文名称:</label>
                            <input name="class_name" type="text" class="text_add" value="{if condition="$class_name
                                neq 'n' "} {$class_name} {/if}" />
                        </li>
                        <li>
                            <label class="l_f">开启状态:</label>
                            <select name="class_status">
                                <option value="-1" {if condition="$class_status eq -1" } selected {/if}>==请选择==</option>
                                <option value="1" {if condition="$class_status eq 1" } selected {/if}>==开启==</option>
                                <option value="0" {if condition="$class_status eq 0" } selected {/if}>==关闭==</option>
                            </select>
                        </li>
                        <li style="width:90px;">
                            <button type="submit" class="btn_search">
                                <i class="fa fa-search"></i>查询
                            </button>
                        </li>
                    </ul>
                </div>
            </form>
            <!--操作-->
            <div class="border clearfix">
                <span class="l_f">
                    <a href="{:url('GoodsClass/add')}" class="btn btn-warning">
                        <i class="fa fa-plus"></i> 添加商品分类</a>
                    <a href="javascript:;" class="btn btn-danger" onclick="formAutoSubmit('id','right_form')">
                        <i class="fa fa-trash"></i> 批量删除</a>
                </span>
            </div>
            <!--商品分类列表-->
            <div class="clearfix">
                <div class="table_menu_list">
                    <form action="{:url('GoodsClass/del')}" method="post" class="right_form">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th width="25px">
                                        <label>
                                            <input type="checkbox" class="ace">
                                            <span class="lbl"></span>
                                        </label>
                                    </th>
                                    <th>ID</th>
                                    <th>商品分类名称</th>
                                    <th>商品分类排序</th>
                                    <th>开启状态</th>
                                    <th>导航显示</th>
                                    <th>添加时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                {volist name="page_data" id="user"}
                                    <tr>
                                        <td>
                                            <label>
                                                <input type="checkbox" class="ace id" name="class_id[]"
                                                    value="{$user['class_id']}">
                                                <span class="lbl"></span>
                                            </label>
                                        </td>
                                        <td>{$user.class_id}</td>
                                        <td class="class_name">{$user.class_name}</td>
                                        <td>
                                            <input type="number" value="{$user['class_sort']}" name="class_sort"
                                                class="class_sort" min="1" class_id="{$user['class_id']}">
                                        </td>
                                        <td>
                                            {if condition="$user['class_status'] eq 1"}
                                                <span class="label label-success radius ajax_get" value="0" title="点我停用"
                                                    type="class_status" class_id="{$user['class_id']}" txt="停用">已启用</span>
                                                {else /}
                                                <span class="label label-default radius ajax_get" value="1" title="点我启用"
                                                    type="class_status" class_id="{$user['class_id']}" txt="启用">停用</span>
                                            {/if}
                                        </td>
                                        <td>
                                            {if condition="$user['class_is_nav'] eq 1"}
                                                <span class="label label-success radius ajax_get" value="0" title="点我关闭导航栏"
                                                    type="class_is_nav" class_id="{$user['class_id']}" txt="关闭">已显示</span>
                                                {else /}
                                                <span class="label label-default radius ajax_get" value="1" title="点我显示导航栏"
                                                    type="class_is_nav" class_id="{$user['class_id']}" txt="显示">关闭</span>
                                            {/if}
                                        </td>
                                        <td>{$user.add_time | date="Y-m-d H:i:s"}</td>
                                        <td>
                                            <a title="编辑"
                                                href="{:url('GoodsClass/edit',array('class_id' => $user['class_id']))}"
                                                class="btn btn-xs btn-info">
                                                <i class="fa fa-edit bigger-120"></i>编辑
                                            </a>
                                            <a title="删除" href="javascript:;" onclick="confirm_msg(this)"
                                                url="{:url('GoodsClass/del',array('class_id' => $user['class_id']))}"
                                                class="btn btn-xs btn-warning">
                                                <i class="fa fa-trash  bigger-120"></i>删除
                                            </a>
                                            <a title="添加子级"
                                                href="{:url('GoodsClass/add',array('class_pid'=>$user['class_id']))}"
                                                class="btn btn-xs btn-danger">
                                                添加子级
                                            </a>
                                        </td>
                                    </tr>
                                    <?php show_child_class($user);?>
                                {/volist}
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-2">
                    <div class="dataTables_info">共 {$page_total} 条</div>
                </div>
                <div class="col-sm-5">
                    <div class="dataTables_paginate paging_bootstrap">
                        <ul class="pagination">
                            <?php echo(htmlspecialchars_decode($page)); ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
</body>
<script src="__ADMIN__/js/common.js" type="text/javascript"></script>

</html>